package com.hippo.javacore.javaiostream.iostream;

import java.io.PrintStream;

/**
 * @ClassName PrintStreamOpt
 * @Description TODO 打印输出流
 * @Author tangxl
 * @create 2023-04-07 08:55
 **/
public class PrintStreamOpt {
    public static void main(String[] args) {
      try (
              // 1.创建打印流管道
              PrintStream ps = new PrintStream("study-commons/java-file-iostream/src/main/resources/file/a.txt","UTF-8");
              ){
          // 2.打印数据
          ps.println(97);
          ps.println("hello");
          ps.println(true);
          // 3.写入数据
          ps.write(97);
      }catch (Exception e) {
          e.printStackTrace();
      }
    }
}
